package com.junlt.p2p.ui.activity;

import android.content.Intent;
import android.os.Handler;

import com.junlt.p2p.R;
import com.junlt.p2p.ui.base.BaseRxAppCompatActivity;

public class SplashActivityBase extends BaseRxAppCompatActivity {

    @Override
    protected int getLayoutId() {
        return R.layout.activity_splash;
    }


    @Override
    protected void initView() {
        //设置侧滑返回是否有效
        setSwipeBackEnable(false);
        CheckVersion();
        Runnable r = new Runnable() {
            @Override
            public void run() {
                Intent intent=new Intent(SplashActivityBase.this,MainActivity.class);
                startActivity(intent);
            }
        };
        new Handler().postDelayed(r,1000);
    }

    /**
     * 获取后台版本号，看是否需要升级
     */
    private void CheckVersion() {
        if(true){
            UpdateApk();
        }else{
            if(isFirstIn()){

            }else{

            }
        }
    }

    /**
     * 是否是第一次进入应用
     * @return
     */
    private boolean isFirstIn() {
        return true;
    }

    private void UpdateApk() {

    }


}
